Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Design a Gravity Form with a simple approval model

by Jan Bachelor July 5, 2021

Create a Gravity form for the super-user rights request

  1. Within your WordPress instance, assuming you have installed Gravity Forms already, go to Forms -> New form. Give it a name such as ‘Super user rights request’.
Start creating a new Gravity Form
  1. Submitee’s name (single line text)
    • Create a new single line text field, label it to something like ‘Submitee’s name’.
    • Under the Advanced tab:
      • Use the same tag: {user:display_name} . This way, the user name will be auto-populated on submission.
      • Set visibility to ‘Administrative’.
Submitee’s name field
  1. Submitee’s email (single line text)
    • Create a single line text field and call it something like Submitee’s email.
    • Under the Advanced tab:
      • Use the same tag: {user:user_email} . This way, the user name will be auto-populated on submission.
      • Set visibility to ‘Administrative’.
Submitee’s email field
  1. HTML block field to explain what are the admin rights for
    • Create an HTML block field and label it as something like ‘About super-user rights’.
    • In the contents, I put this text with the HTML tags:
<b>1) Why would you need super-user rights?</b><BR>
The super-user rights can be used to <strong>install software</strong> that is not available in the Self Service app on your Mac.<BR><BR>
<b>2) What happens after you submit this form?</b><BR>
Your manager will need to approve it. They will receive an email notification. You will be granted the permission only after they approved it. For emergencies, contact IT.<BR><BR>
<b>3) How long will you have the super-user rights upon approval?</b><BR>
The effect lasts only for 48 hours after the approval has been granted by your manager.
An example HTML block to explain the users about what this form is about.
  1. Paragraph text – let the users explain what they need the admin rights for?
    • Create a paragraph text field and call it something like ‘What do you need the super-user rights for?’
    • In the tooltip / description, you can add ‘For example, write the name of software you cannot find in the Self-Service app.’
    • Tick the box that it is a required field.
    • Under the Appearance tab, you may wish to select the Field size to ‘small’, as we do not expect more than three lines of text in the reply.
A required paragraph text field to let the users explain what they need the admin rights for.
  1. Consent field – let the users agree to a policy or Terms & Conditions
    • Create a consent field, label it as something like ‘Policy agreement’.
    • In the checkbox label, add an actual agreement statement such as ‘I agree to with the super-user rights access policy below.’
    • In the tooltip or description, add more details such as: ‘Read and review the policy below. If you agree, tick the box that you consent with the policy. This is required before the workflow can proceed.’
    • Tick the box that this is a required field.
    • Under the Appearance tab for custom validation message, customize the text to something like ‘Your agreement to the policy is required. If you have a concern, please contact the HR team.’
Consent field to let the users agree to a policy that we will display below.
  1. HTML block for the policy statement
    • You may wish to have the policy stated in the field above, but if it is longer, it may not be very easy to read / navigate through it. Since some companies use Google Workplace (formally known as G Suite), I created a suggestion below for having the policies in an embedded Google Doc using a Google Drive Embedder WordPress plugin (free version).
    • The idea is that those who have write rights can edit it directly, which would be just a few people (like HR / Legal team). All others would have read-only access.
    • Nevertheless, this block adds a layer of complexity, as the user needs to be logged into their Google Workspace account, or else an error message is displayed. So use this field only if it suits your needs.
    • Once you have set up your Google Drive Embedder plugin. grab a document ID (right part of the URL when you open a Google Doc) and add the following text in an HTML block:
[google-drive-embed url="https://docs.google.com/document/d/<DOCUMENT_ID>/edit?rm=minimal" style="embed"]
Policy statement that is fetched from Google Docs using a shortcode through the Google Drive Embedder plugin.
  1. Add two more single text fields to fetch results from Integromat
    • The idea is that when Integromat carries out the job of adding/removing the user to/from a group in Jamf Pro via the JamF API, the Gravity workflow in WordPress needs to receive an information about it – was it successful or not?
    • Each field is used to map something else in case the workflow in Integromat gets stuck or does not complete – this will be explained in the next step.
    • Create one single line text field called ‘User found in JamF’ and mark it as hidden in the Advanced tab.
    • Then create another single line text field called ‘User added to Super Users’ and mark it as hidden in the Advanced tab.
Create two more empty hidden single text fields to store values there later when the workflow is triggered.
  1. Preview the form
    • Save the form and click on the ‘Preview’ button on the top. Go through it and try to fill it in. Are the required fields for the reason for wanting the admin rights and for the consent marked as required? Test it out.
Preview the form and make sure it works as expected, inc. the embedded policy (if you are using the Google Doc approach).
  1. Publish the form to review styles and look & feel
    • Create a page in WordPress and use a shortcode to add the form in it.
    • I recommend using enhanced visual editors like Elementor, Divi, etc. to make your life easier.
    • Then view the page from there to verify that it works and looks as expected. You can then un-publish the page if you prefer users not to be able to access it (or simply do not mention the URL anywhere or block it for certain roles using other plugins).
Add a shortcode onto a page in WordPress

Now, since we have the form ready, let’s create an API account in JamF and prepare our workflow in Integromat!

Pre-requisities - what software licenses will you need
Access JamF Pro via Classic API - test connection with Postman
Go back to course overview: Create an automated Gravity workflow that will allow users to request admin rights for their Macs in JamF Pro using Integromat and JamF API.

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 FacebookWhatsappEmail

Course Steps

  1. What are we trying to do, why and how will we get there?
  2. Pre-requisities - what software licenses will you need
  3. Design a Gravity Form with a simple approval model
  4. Access JamF Pro via Classic API - test connection with Postman
  5. Create JamF Pro scripts, static groups and policies + a system account for API access
  6. Use Integromat to get computer IDs from user email in JamF Pro
Previous Next

Recent Comments

  • Jan Bachelor on Dynamic DNS Set Up with DuckDNS on OPNSenseHi Jake, that's awesome, congratulations on getting…
  • Jake on Dynamic DNS Set Up with DuckDNS on OPNSensefollowed guide above to the T and all is working. i…
  • Fastbrain on Dynamic DNS Set Up with DuckDNS on OPNSenseThanks for the guide. For some reason, after follow…

Other courses

Install iRedMail Mail Server As Proxmox VM With...

October 31, 2024

Remote Bucket Storage for Proxmox VM Backups

August 16, 2024

Concur Alternative: Import Employees’ Credit Card Expenses to...

January 19, 2024

Create an automated Gravity workflow that will allow...

January 19, 2024

Dynamically Populate Gravity Forms from Google Sheets (GSheets...

March 16, 2021
Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Recent Posts

  • How to join two Proxmox nodes into a cluster (PVE 8.x)

  • How to Rename a Proxmox Node

  • How to mount an NFS share on an Android box

Facebook Twitter Instagram Pinterest Linkedin Youtube

All Rights Reserved. The theme was customized from Soledad, see PenciDesign