Formula for finding last date returns correct...

(ControlProcess Pav) #1

Formula for finding last date returns correct value when testing inside expression builder, but wrong value in the App itself

In my Risk Analysis App, user inserts a risk and then can insert several analysis.

each time user inserts a new analysis, it records the time the new analysis was registered or edited and the date for the new analysis (based on a number of days user inserts + analysis creation date)

They are shown correctly on their own register.

However, when returning to the Risk Register Screen, it should show the last Analysis Creation Date and the date for the next Analysis.

I am using the formula max(select(xxxx)

When I test the formula, it returns me the correct dates… for example… next analysis in 16/05/18, based on last analysis insertion date + 30 days.

I save, go to the app, run the app, what do I find on the Next Analysis? Today’s date.

PS: yup, I DID delete the initial value “today()”.

(ControlProcess Pav) #2

Well, ok, I found out the problem.

I created a new register for the Risk. I save it.

The Risk Analysis however is another table (a child table). When I create or edit the child table and save, it records the new Dates.

BUT it doesn´t update the parent table Last Analysis and Next Analysis dates.

I need to EDIT the Risk register. When I do that, it updates the dates. Then I save and it’s there.

Should I give up on showing those dates in the Risk Register as fields? Is it impossible to update a register field unless you edit that register?

And instead, just order the child table by those dates) (although you can´t directly in the inline view, decide if you want to order the table by Next Analysis Date or Last Insertion Date.

(ControlProcess Pav) #3

Hmmm… changed the Google terms and found this. Seems to be the solution, but quite complicated. - Changing Data from a Workflow Rule or Scheduled Report Changing Data from a Workflow Rule or Scheduled Report

(ControlProcess Pav) #4

Ok, update and new problem.

Changed the whole thing. Instead of being free to just add new items to the child table (thus, creating the necessity to control last Date Analysis and Next Date Analysis) I decided it would be better to only be able to create a new Analysis FROM an old analysis.

That is, user enters the previous analysis and through actions, deletes fields of the next analysis in the current row, then copies the row and edits it.

The problem is that the Next Analysis is a formula. Creation Date + Days for Next Analysis.

So I can´t delete it with Action Buttons.

Changing the value of Days for Next Analysis to Zero or Negative doesn´t help much, because you will still have a date appearing on the table view, making it confusing to see only the register that matters, the one with the Next Analysis Date.

Tried some tricks to delete Next Analysis. One that seemed it would work however FROZE AppSheet, probably because the empty value was not accepted.

Tried a Valid If rule to make it blank, but it did not change the cell value to blank, it only did not accept the non-blank value of date+days…