Linktorow with prefilled values

I want to have an action open up a view to edit the same row with one field prefilled with value from an expression.

I know that linktorow() is the way for that.

But I dont know how to prefill one field.

Is there a way to do that?

Solved Solved
0 16 1,449
1 ACCEPTED SOLUTION

This isnโ€™t possible via a single action. LINKTOFORM can pre-fill columns, but only for new records.

One option would be to use your expression as the initial value for the field, as well as setting an appropriate reset_on_edit expression.

Another option would be to run a grouped action that first sets the value of that column, and then opens the form.

View solution in original post

16 REPLIES 16

This isnโ€™t possible via a single action. LINKTOFORM can pre-fill columns, but only for new records.

One option would be to use your expression as the initial value for the field, as well as setting an appropriate reset_on_edit expression.

Another option would be to run a grouped action that first sets the value of that column, and then opens the form.

Hi Marc

Could you please explain how to do this: โ€œOne option would be to use your expression as the initial value for the field, as well as setting an appropriate reset_on_edit expression.โ€

I tried the other method you suggested by group actions. But it this case it fired the first action (i.e. to set the column value", but the second action (linktorow) did not open the form.

Thanks in advance.

You would need some way to determine when the value is supposed to be filled in. That can be by using a different Form view, or perhaps by some data point in your app that is specific to the โ€œstageโ€ that the record is in. You would then construct a resetOnEdit expression to returns true in such cases, and an initial value that returns the pre-filled value in those same cases. Which part exactly doesnโ€™t make sense to you?

Please provide screenshots of the action definitions.

In a grouped action, the action stops after the first navigation action. Because the first action in your grouped action is a navigation action, the second action is never performed.

@Steve I actually tagged you in here regarding any help articles about โ€œreset on editโ€.

Hi Marc

Thanks for the reply. From the first part i didnt understant the resetOnExit as I cant find any examples of how to use it and I cant find in Appsheet where this is setup.

For the 2nd option, I am getting a strange behavior. In one case of my actions it is working ok but in all other cases it is not working.

My app is using a single googlesheet to track our customer orders and tracking the order deliveries. The status of the tracking goes from NEW -> In Progress -> On the WAY -> Completed. In each stage i am collecting some information about the order (e.g. who is loading, who is packing, vehicle number, driver etc). After collecting the info i want to change the Status.

The problem i have is I am not able to open a form to update the info and then do another action to update the status. In my first Behaviour setting from NEW to IN Progress, i have a form and then when the Form is saved i fire another behaviour action to save the Status as โ€œIn Progressโ€. This form and behavious is working fine.

BUT the same setup for the other Status is not working. Thats why i setup an action with multiple actions. Even in this case only the first action is fired (i.e. the form to collect the info). But the second action (to change the Status) is not fired.

Hope the explanation is clear. Look forward to your reply soon.

Thanks
Fuzz

I guess there arenโ€™t any help files for resetOnEdit? @Steve? But thereโ€™s always google:

Reset on edit is here in a columnโ€™s definition:




You need to change the order of action execution in your Grouped Action. Whenever any navigation action is executed in a Grouped Action, the entire group stops, so any navigation actions need to be last (and only 1).

It also looks like you didnโ€™t actually set the Grouped Action "Set as โ€˜On The Wayโ€™ " as the Form-Saved Behavior, it is still set to "Change Status to โ€˜In Progressโ€™ ". I personally always name my Grouped Actions with the word โ€œGROUPโ€ in them for clarity.

Hi Marc / Steve

I tried both ways before as well. I.E Changing the Status first and calling the Form second. Even then Status was not changing.

What i tried next is even more strange. I removed the Get Progres Info and left ONLY ONE action โ€œchange the statusโ€, but even in this case the Status was not chaning.

After a lot of testing what i am noticing is ONLY the first action to change the Status works. I mean the first time from NEW status to any other status works ok. But from any other status any action to change the Status does not workโ€ฆ

Any ideas what i might be doign wrong, or pls suggest any other option to achieve what i am trying to do.

Thanks
Fuzz

Is there any way to pass the Status value to the form using LINKTOROW() call ?

linktorow() is for editing the current row.

Linktoform() is for adding a new row to some other table and editing that row.

Keep this basic difference in mind always.


when you click a button running on linktorow(), you will always end up having the previous value on a column(s) that was recorded for the column(s) that you are trying to edit.

when you click a button running linktoform(), you can set values within the linktoform expression that prefills the new row with the appropriate values.


If you want to edit the same row and have some column value set to a new one (maybe from blank, maybe overwriting an old one, doesnโ€™t really matter), you need to have a data change action acting in unison. The basic flow would be :

Button clicked -> data change action triggered which sets the column value -> navigation action takes the user to the new form showing the changed data.

Make sure to make a โ€˜grouped actionโ€™ that comprises of the data change action and the navigation action. Make sure to keep the proper order of actions in the grouped action as data change actions will not be triggered if navigation action is triggered first.


This was exactly how I did it. I donโ€™t know about the reset_on_edit mechanism, so Iโ€™m equally eager to know if someone comes up with that.

I would suggest against expecting exact solutions and to get your hands dirty a bit first. That immensely helps narrowing down the problem and to come up with more appropriate solutions.

HI Pratyay

I searched a lot of examples and forum questions and realised the difference of LINKTOROW and LINKTOFORM as you explained. BUT i also didnt find any way to parse value to a LINKTOROW call. Thats why i tried to below 2 options:

  1. Open a form to edit the row --> and then Upon saving the form:

    • First i set a button with action โ€œopen a form to edit this rowโ€
    • Then form Behavior->Event Actions->Actions to take when events occur. -> and running an action to save the Status
  2. Group action

    • 1st action -> Set the value of a colum in this row
    • 2nd action -> Open a form to edit this row

I am trying to find why in both methods my Status field is not getting updated. Any help much appreciated pls.

Thanks
Fuzz

While I donโ€™t know (because I havenโ€™t dug yet) why an โ€˜open a form to edit this rowโ€™ action is not working as expected, what I can tell you is that I have been able to make this work using the second action as linktorow([key column], โ€œview name from the table/sliceโ€).

Hi Pratyay

Thanks for that. After lot of debuggin i found the problem. I created the action completely again and it worked. After checking what i had done wrong in the previous action i realised I had set a condition in my Behaviour action that was preventing it from running.

Also i got it work without the group action. What i did instead of group action is I did first action with LINKTOROW that called a form and that form I had a behaviour upon form completed that ran the second action to change Status.

This method was better because in the group action scenario i had to run the change Status action first and then call the LINKTOROW. The problem is that after the first action the LINKTOROW opens the form, but if in case the use doesnt change anything and instead presses back/cancel button the Status is already changed and hence in a wrong Status.

Thank you for the help and suggestions.

Fuzz

Any chance LINKTOROW() or a similar function will allow you to edit a row of another table, without extra coding, in the future? 

Doubtful

Top Labels in this Space