I have 3 tables
- TRACKING NUMBERS (a basic list of key ID's that I use to link all parts of a project)
- PURCHASE LOG (a place for a company purchaser or shipper receiver to log purchases - Using the Tracking numbers as a P.O. number)
- TIME LOG (a place for field technicians to log time to a tracking number, and also select which purchases they have used on a job)
A field technician makes a time log entry to a specific tracking number. The time log pulls up all purchases for the tracking number in an inline view.
I have 2 actions set up.
1. The red "X" - Both shows unclaimed purchases for the job, & if you tap it when its grey it clears a claim on a purchase.
2. The green "✓" - Both shows a claimed purchase for the job, & if you tap it when its grey it claims a purchase.
Currently when you tap on the "✓" it pulls up the INPUT() window and makes you pick from all of your time inputs related to the tracking number. I was wondering if it was possible in the action via a formula to have the action search the REF table and if it only finds 1 possible value to return that value, else ask for user INPUT().
I have attempted to add an IF() to the claim purchase action with no success as follows:
IF(
COUNT(
SELECT(TIME LOG[KEY ID],
AND(
[TRACKING NUMBER KEY ID] = [_THISROW].[TRACKING NUMBER KEY ID],
[REPORTED BY] = USEREMAIL(),
[DATE] = TODAY()
),FALSE)
)>1, INPUT("PICK TIME LOG:",[TIME LOG KEY ID]),
ANY(
SELECT(TIME LOG[KEY ID],
AND(
[TRACKING NUMBER KEY ID] = [_THISROW].[TRACKING NUMBER KEY ID],
[REPORTED BY] = USEREMAIL(),
[DATE] = TODAY()
),FALSE
)
)
)
Is it just not possible or is my formula logic out to lunch?
Solved! Go to Solution.
Not possible. INPUT() can only be used as the sole function in an expression, so you can't have some sort of condition to determine whether the field is updated through an input or something else.
Another option is to use more than one action, both having the green tick icon but one going to the input and the other just setting the value directly. You could then use an expression to determine which to show.
Make 3 Actions instead of 1.
Not possible. INPUT() can only be used as the sole function in an expression, so you can't have some sort of condition to determine whether the field is updated through an input or something else.
Another option is to use more than one action, both having the green tick icon but one going to the input and the other just setting the value directly. You could then use an expression to determine which to show.
"Another option is to use more than one action, both having the green tick icon but one going to the input and the other just setting the value directly. You could then use an expression to determine which to show."
An Action's condition plays a bit of double duty. It can determine both whether or not to be visible, and/or whether or not to be executed within a Group.
For the visibility duty, It would have to evaluate the condition every time the user navigates to the View holding it, just like Format Rules. If it is set with inline visibility, on a Table View with many rows, this condition evaluation could cause some UI slowdown, especially with SELECTs.
I assume, but cannot prove, that if the Action is set to "do not display", that the system is smart enough to not try to evaluate the condition during view navigation. So for Actions within a Group, the condition would hopefully only be evaluated when the entire Group is being executed.
For this reason, I'd go with my suggestion in the above post, instead of your suggestion. Both are perfectly valid of course, and the difference may be mostly negligible. Just thought it may be helpful to explain that little bit of performance-tuning.
@Marc_Dillon I actually started typing out the group action approach, the only reason I went with conditional actions, is that I assumed the original poster must already have them to show the green ticks and grey ticks with different actions.
Thanks for the feedback Sirs. I will see which approach best fits my needs. I feel silly that I didn't think of either of the "Hide & Replace" action options.
@graham_howe Thank you for confirming my suspicions regarding Input().
User | Count |
---|---|
15 | |
11 | |
10 | |
8 | |
3 |