Jump to content
  • 0

New User Parm Flag - Passing It to a datapage


Question

Hi everyone

Pretty new user here...I don't think Caspio can do this but I'll ask...

I have an application I'm building where I have a settings table...This table has a flag field that is populated when a  new user has set up their profile properly.  Lets call the field:  Profile_Parm1...which is a text 255 format...If the field is blank, its an indication that the new user has not done all the new user admin steps.

I'm trying to create a form / process where this settings table is read (based on their authentication ID)  and simply retrieves the parameter: Parm1Profile_Parm1...the goal to receive it, then pass it to the  next form.

Here is how the application will work:

When a user tries to click on a link, (i.e. Add Item), I want to build a form to retrieve the parm first, then goto to the ADD ITEM html page if Profile_Parm1 is populated(i.e. Normal flow).

If its blank, I want to use some java script to not only tell the user that they need to complete the new user process first, but I want to automatically reroute them to the settings page form (New User Flow).

Is this even possible?

Thanks everyone

 

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi Golfedad,


I would suggest to use JS that redirects the user based on check performed on one of Authentication field.

Below you may find sample code which I have used previously:

<button onclick="myFunction()">Add Item </button>

<script type="text/javascript">

function myFunction() {

var cb_text = '[@authfield: Profile_Parm1]';
  
    if (cb_text == 'Admin') {
    window.location = "URL_1";
    } else {
    window.location = "URL_2";
    }
}
</script>

You may place above code in Header/Footer/HTML block of Datapage.

Please make sure that you disable HTML editor.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...