Using value from a field to bring up different data entry forms based on slices

I have a form that has one field on it (PI_NO). It asks the user to select a role out of 7 possibilities. I need to open a different form based on a slice of data dependent upon the role selected. In other words, instead of hiding and show fields based on the PI_NO value I want to use views based on slices to simplify things.

  1. How would I call the correct form based on the value of PI_NO?

  2. How would I pass that value (PI_NO) to the newly open form and fill in the PI_NO on that newly opened form?

Does this make sense?

Thanks.

Lucinda

0 18 1,988
18 REPLIES 18

So you open up the first form that has one Enum field, and you want to forward the user to another form dependent on the selection from that field?

Sounds like you need to do the following:

Create a UX->Action โ€œApp: go to another view within this appโ€
Enter an expression like this:

LINKTOVIEW(
SWITCH( [PI_NO],
โ€œValue 1โ€ , โ€œForm 1โ€,
โ€œValue 2โ€ , โ€œForm 2โ€,
etcโ€ฆ ))

Now go into the view settings for the first form, and under the Behavior section, set this action as the Row Selected action.

If you need to pass the value of PI_NO, or anything else, change LINKTOVIEW to LINKTOFORM.

Marc,

Thank you for your quick response. I inputed an expression based on yours. But I hit another problem.

2X_1_1d98c425ff708653a65aec356280f1aae2ddc962.png
But I canโ€™t get the key field to properly set the value to UniqueID(). See the screenshot. I use this in another table and it works fine. I even deleted the table in the spreadsheet and started over.

Do you have any tips?

Thanks. Lucinda

What is the expression that you used?

LINKTOVIEW(
SWITCH( [PI_NO],
โ€œ2โ€ , โ€œJFAPI_Data_Entryโ€,
โ€œEnter Requestโ€ ))

I only have one data entry screen created, not the seven I will need.

As soon as I click save, I get the error about key field being required which I assume comes before the expression.

That error pops up preventing you from saving the first form?
There is no value being populated in that field that you can see?
How are you getting into that form in the first place?

I set that form as the opening form/view for the app.

I tried to set the key field to show but it keeps being hidden. It certainly appears that the UNIQUEID() is not populating that field before the record is being saved. I even tried setting the automatically created _rownumber field to be the primary key with UNIQUEID() but got the same error.

Ok. I set up another app just to test. I only had two tables and it worked. I went back to my app and made sure everything matched on this form. Still didnโ€™t work. I renamed the action and deleted it from the Row Key and the record saved correctly. So it IS something with my action that is causing problems.

Iโ€™ll work on that aspect. I appreciate the time youโ€™ve given me.

Lucinda

Here are my three attempts at writing the LINKTOFORM expression. I get errors each way I try it. I want to pass the PI_NO from the initial form to the proper data entry form selected by Role (PI_NO) in the initial form. Each form being called is based off a slice all from the same underlying table.

Any help will be appreciated. Thanks.

That last one should work, just missing a comma and opening quotes before PO_ID" near the end.

A million thank youโ€™s Marc. It works!!! I did find that I missed read your โ€œNow go into the view settings for the first form, and under the Behavior section, set this action as the Row Selected action.โ€
I had to put it in the Behavior Form Saved section. See screenshot.

I sooooo appreciate your patience and help.

Lucinda

Great. Oh yah, form saved, my mistake.

I have two more questions. The PI_NO value gets pre-filled in on the proper form after saving the initial form. All good.

  1. I want to hide, or lock, the pre-filled field PI_NO on the data entry screens so the user canโ€™t inadvertently change it. If they changed it, the data entry form they are on would no longer be the correct one.

  2. On the data entry forms, when the user saves the form, a new blank one is opened. It no longer has the PI_NO field pre-populated. Is there a way to have it use the value from the form just saved? Normally, the user would not need to change the PI_NO (role) during a session.

I guess I could force the user to go back to the opening screen and re-enter their role in the PI_NO field in the opening screen but Iโ€™d prefer to eliminate that extra step.

Thanks again for your help.

For #1, you could use a CONTEXT() expression in the Editable_If field.

For #2, you can create another LINKTOFORM form-saved action for this form. You can leverage the CONTEXT() expression again to use the same action for all 7 forms.

Or just set Editable_If to FALSE. That prevents any user modification at any time, but still allows actions to modify it.

Great. I really appreciate it. Iโ€™ll give it a try.

Thanks again. Got that all working. I created an Onboarding view with 7 screens of helpful tips.

How do I, 1. move to my opening form after the user finishes reading each tip? I created an Action to open my opening form but canโ€™t see where I can add it to the Onboarding form.

  1. How do I add a button to skip the onboarding and go straight to the opening form? I could use my action to do this if I can figure out how to add a button to the Onboarding type of form.

Thanks.

Iโ€™m sorry I am not familiar with onboarding views. Please search this forum for more info about them, or maybe make a new topic.

Thanks Marc. I did make a new topic. I just read every entry with the word Onboarding in it. Hopefully someone will know how to help. I have a work around until then.

Take care

Top Labels in this Space