I am new to Appgyver and am exploring it, reading the docs and watching the videos. The exercise I am doing is simple (I thought). I want to put an input component on a page , the user types in a value, the value is looked up in a database and a message is displayed on whether it is found or not. Simple.
I have successfully hooked up to Airtable (got one table there with a couple of records), and successfully created a page in Appgyver with a input component and a button.
When tapping the button I have discovered that you cannot use Get to retrieve a record unless you have the ID, which the user would not know. Instead I have to use GetCollection with an Airtable function called filterByFormula to give me a 1 record collection. That seems to work.
But I cannot figure out how to get to the properties (fields) of my 1 record collection. I have watched the tutorials but they all use the strategy of displaying a list, which will give an ID to use to with a GET. Records retrieved with a GET, gives access to the data fields.
So far, to the button I have attached a flow component, GetRecordCollection - that works, it seems to retrieve the correct data. Then attached to the GetRecordCollection is an Alert component to display the value of a field from the data.
And here is the brick wall. The field names are not available in my data variable. The data variable is an object and will not drill down to the fields. How do I make the fields available?
I feel like I am conceptually wide of the mark, so what is wrong with my approach to this simple exercise?
Hi, it seems that you haven’t used Set data variable Flow function after you have used the Get record collection Flow function. It has to be used to save the response result to Data variables to be used in other parts of the page/logic. Basically, Get record / Get record collection don’t save the data themselves to be used in the app, but just tell what the backend’s response was.
I have tried to Set an App Variable to be equal to a Data Variable after a GetRecordCollection flow.
I created the App Variable as an object with properties to match the Data Variable’s properties.
But when I use the Set App Variable flow to assign the Data Variable’s value to the App Variable, the Data Variable shows as incompatible and will not allow access to its property list.
What am i doing wrong?
Probably the schema of the app variable isn’t exactly the same. All fields would need to be exactly the same type. Or you can circumvent this by using a formula binding instead.
Hi Mevi, all variables in my simple app are text or object. The problem, as I see it, is that the data variable of the REST API schema will not allow access to its properties ie each individual field. Because that cannot happen I do not have an opportunity to assign a data field to an app variable (as an example). The message is always ‘Incompatible’ at object level. Why? I do not know, its very counter intuitive. Appgyver should address this. Anyway, I did find a solution using repeating cards, its a clumsy work around, but it does work. Appgyver is too good to let a little road block like this get in the way.
Hmm, I’m not sure if I understand you correctly, but from the AppGyver side, there is no restriction regarding accessing data variable fields. I have many occasions where I assign data from app variable to data variable or the other way around, or access different fields, so there’s something specific going on that you aren’t able to do what you want, or I’ve somehow misunderstood the situation. But if you’ve found a solution that works for you, I guess that’s that
Facing the exact same problem. Any way to access the fields directly?
The problem for me was definitely a beginners problem, and I got thru it once I understood the underlying structures of the variables. Took some experimentation and persistence. Unfortunately I posed the question in such a generalised way they Mevi did not know what I meant. The thing to learn is when a variable is just a variable (and the type of variable it is) or a structure. They do not want to mix, which generates an incompatable error. In my opinion the error message is misleading,.
Another message that is misleading that you may see is ‘Redundant’, It actually means a variable is deleted or renamed, does not mean a feature is no longer supported.
Good luck, light bulbs do come on now and then, just takes persistence.