So, I have an inspection app with three table INSPECTIONS, STAFF, AND LOCATION.
I assigned the user of the app as a default value to INSPECTOR column, column type is text and app formula is:
SELECT(STAFF[INSPECTOR], [EMAIL] = USEREMAIL(), TRUE)
By nature of the formula, it is working and the user of the app donโt need write his name to the INSPECTOR column.
The problem is ref column donโt accept app formula to evaluate the action above.
So I can not use reverse reference. Any idea is appreciatedโฆ
Solved! Go to Solution.
In order to dereference a value, the value must be of the Ref type. Based on what youโve shared, I would suggest you replace your SELECT() expression with the following:
ANY(
FILTER(
"STAFF",
(USEREMAIL() = [EMAIL])
)
)
This will produce a Ref to the row in the STAFF table that corresponds to the current app user. Also change the column type for the INSPECTOR column to Ref (if the app editor doesnโt automatically change it) and set the columnโs Source table to STAFF. Once the column type is properly set, youโll be able to dereference the column value in expressions.
See also:
#open
Please explain in greater detailโI donโt understand what you mean. If there is an error message, please share a screenshot.
Hi Steve thank you for your response,
I have an inspector column which type is text, I made it in purpose and the column app formula is below
SELECT(STAFF[INSPECTOR], [EMAIL] = USEREMAIL(), TRUE)
with this forumula, I can capture users mail adress and refer it to inspector name column directly. So when user signed in they are not allowed to enter their names, they just take photos ant fill the forms.
But when the inspector name column is a test and I canโt make reference or any relation between inspections table and staff table. Therefore I canโt view the inspection that made by this user. (reverse Reference)
ฤฐs there any other way to create reverse references.
Thank you so muchโฆ
In order to dereference a value, the value must be of the Ref type. Based on what youโve shared, I would suggest you replace your SELECT() expression with the following:
ANY(
FILTER(
"STAFF",
(USEREMAIL() = [EMAIL])
)
)
This will produce a Ref to the row in the STAFF table that corresponds to the current app user. Also change the column type for the INSPECTOR column to Ref (if the app editor doesnโt automatically change it) and set the columnโs Source table to STAFF. Once the column type is properly set, youโll be able to dereference the column value in expressions.
See also:
Thank you very much Steve for your help
I have just changed the formula, save the app and it worked like a charmโฆ
User | Count |
---|---|
41 | |
27 | |
27 | |
20 | |
13 |