Call a process when button clicked

I have a news app that allows users to read news items.  It looks like this:

Scott_Nesbitt_0-1662494059802.png

When they click GO TO DETAILS it shows the full news item.  I would also like it to call a process I have that updates a column in a related table so the news item is marked read.  I am not sure how to call that process, could someone assist?

Alternatively, instead of "Data: Add a new row to another table using values from this row", I would like "Data: Update rows in other table using values from this row", and then I could use this:

FILTER("Read",
               AND(([News Id] = [_THISROW].[News Id]),
                         [User Email] = USEREMAIL()
                       )
)

Is that possible?  Or perhaps there is a different way that I am missing.

Solved Solved
0 6 174
1 ACCEPTED SOLUTION

Unfortunately, we cannot assign values through references.

I didn't explain things well.  Below is an image that corresponds to #2.  This is the action to add to the Group mentioned in #3.  I refer to this type of action as a "bridge" action as it allows you to transition processing flow to another datasource to perform updates.

Screen Shot 2022-09-07 at 3.00.49 PM.png

View solution in original post

6 REPLIES 6

You would want to create a Grouped action as your "Go To Details" button.  In that Grouped action, add the current action you are using.  Don't forget to move the "Only if true" criteria...if any.

Then, add to the Grouped action another action or action set, that update the news items "read" column .  This requires 2 actions:

1) create an action for the table where the row is being updated as type "Data: set the values of some values in this row".  Select the column and assign the value that indicates it is read.

2) create action - "Mark Read' - for the table shown in your view of type "Data: execute an action on a set of rows".  Set the referenced table and referenced action as those in 1) above.  The set the Referenced Rows property to:

FILTER("Read",
               AND(([News Id] = [_THISROW].[News Id]),
                         [User Email] = USEREMAIL()
                       )
)

3)  Add this new action to the top of the Grouped action list.  Unfortunately, any actions that perform navigation MUST be the last action in the list.

So the idea is that when the button is clicked, the Grouped action is triggered.  The first thing done is to switch to the "Mark Read" action sending the identified row to update the column to indicate READ.  Then the GRouped action fires off the second action that will navigate to the news item for reading.

Thank you for the response.  Everything makes perfect sense, except for the Mark Read action.  I cannot add that to the Grouped Action because it affects a different table (the "Read" table) than the Grouped Action (the "News" table).

Scott_Nesbitt_0-1662572976944.png

Is there some way I can update through the reference?

Thanks again.

Unfortunately, we cannot assign values through references.

I didn't explain things well.  Below is an image that corresponds to #2.  This is the action to add to the Group mentioned in #3.  I refer to this type of action as a "bridge" action as it allows you to transition processing flow to another datasource to perform updates.

Screen Shot 2022-09-07 at 3.00.49 PM.png

Thank you, the "bridge" action worked just right.  I did have to turn off Automatic Updates so the users would not have to wait to read the news article, but I suppose that is not a big deal.  I do wish the sync would happen in the background, kind of like a lazy sync.

If you have Delayed Sync and Automatic Updates on, Syncs DO happen in the background in 2 scenarios

  1. An automatic Sync occurs every 30 minutes since last activity.
  2. Anytime an edit is submitted, a Sync will occur covertly in certain circumstances in the background.

If you are performing updates on the device side - Add by Forms,  Edits and device side actions - all updates will be seen immediately on the device.  If you are not seeing that or there are explicit Sync's interfering with the viewing the data, then you likely don't have the Sync settings for your needs.

For app situations like described above, I recommend having Delayed Sync and Automatic Updates turned on.  All the others are self explanatory.  I do NOT recommend Delta Sync unless you have very large datasets - Tens of thousands of rows in multiple tables.

 

Good advice; with these settings it syncs after just a few seconds while the user is reading the news.

Top Labels in this Space