REF_ROWS() doesn't return any rows between primary key and foreign key

As the title suggests, Iโ€™m using some REF_ROWS() formulas for one of my tables โ€œAsset_reportsโ€.
In this table I have a column โ€œUIDโ€ acting as the key. In a few other tables, I have the same โ€œUIDโ€ column which is of type Ref pointing back to this table, acting as a foreign key. Naturally Appsheet automatically creates virtual list columns with a REF_ROWS() formula in the original table, pointing to these tables, but for some reason, the formulas donโ€™t return any rows from these tables.
I double checked the backend data, and am 100% sure, that I have rows in these tables where the content of the โ€œUIDโ€ column matches the โ€œUIDโ€ column of some rows in the original table โ€œAsset_reportsโ€.

Any ideas to why this is happening? Let me know if you need more information.

Best regards

Solved Solved
0 7 362
1 ACCEPTED SOLUTION

Update:

I tried removing the โ€œRead-onlyโ€ property from all the relevant tables, allowing edits, adds and deletes, and then all the lists showed up. Apparently having them read-only breaks it? The odd thing is though, that after the list appeared, I put the tables back in read-only, and the lists are still there. Not quite sure whatโ€™s going on here, but now I wonder if the app will add new rows to these lists when the tables are in read-only? Iโ€™m guessing not.

View solution in original post

7 REPLIES 7

Steve
Platinum 4
Platinum 4

The REF_ROWS() expressions auto-generated by AppSheet in the virtual columns auto-generated by AppSheet that have not been modified in any way by you are producing no results?

Please provide screenshots of one of the problem REF_ROWS() expressions, its column configuration, and the column list of the table to which that REF_ROWS() expression refers that includes at least the column to which the expression refers.

That would indeed be my impression, although Iโ€™m sure the answer is somewhere.

Here is an image of a configuration of one of the REF_ROWS() formulas that doesnโ€™t yield any results:

And here is an image of the table columns that the formula is referring to (not all columns are included here):

According to my backend data, the formula should return one row, as there is one row in โ€œAsset_CPUโ€ that has the same UID as in โ€œAsset_reportsโ€

Let me know if you need more information

I would recommend removing the apostrophe (') from the column name, though I donโ€™t suspect thatโ€™s the problem here.

What happens when you use the Test button in Expression Assistant for the REF_ROWS() expression?

Removed the apostrophe, but as you said, no difference.

Iโ€™m not quite sure how to interpret these test results, but it seems like it doesnโ€™t return anything, when running the formula?

Update:

I tried removing the โ€œRead-onlyโ€ property from all the relevant tables, allowing edits, adds and deletes, and then all the lists showed up. Apparently having them read-only breaks it? The odd thing is though, that after the list appeared, I put the tables back in read-only, and the lists are still there. Not quite sure whatโ€™s going on here, but now I wonder if the app will add new rows to these lists when the tables are in read-only? Iโ€™m guessing not.

That behavior definitely seems odd to me. If this continues to be a problem or becomes a problem again, I recommend engaging support@appsheet.com.

Will do. Thanks for the help!

Top Labels in this Space