Hi All,
I want to populate an Enum type column with a specific value when I enter the form view. The form view is entered through the โBehaviour actionโ - โApp: Go to another view within the appโ. I selected โLINKTOFORMโ expression to gain access to the form view (I know there are other ways to enter a form, but in my app, this โbehaviour actionโ is what I specifically want to use to enter in to the form view). The form has an โEnum type columnโ called [Station] which has a list of hospitals in the country assigned to it via a โData Validityโ - โValidIfโ expression (The Google Sheet has a table called โUroStationsโ, in it thereโs a column called โStationsโ that has the list of Urology Stations in the country, and this is the column that populates the [Station] column in the form view).
The functionality of the app goes like thisโฆ The app first shows a view (A card type view) that allows the user to select the Urology Station (for this purpose, the card type view uses the โUroStationsโ tableโs [Stations] columnโs values), and when the user selects a specific station, the detailed view of this specific row is brought up and it has few โBehaviour actionsโ. One of the behaviour actions is to โCreate a new entryโ using the form view, and what I want is this form viewโs [Station] Enum type column (which is a pull down menu which has all the Urology stations in the country) to just show the specific โStationโ that user initially selected from the app in the first view, so that the user doesnโt have to select the โStationโ again.
Is this possible? I tried LINKTOFORM(โPatient Details Tableโ,โStationโ,[_THISROW].[Stations]), but this didnโt work.
Ironically, when I enter the table view through a Behaviour Action called โLINKTOFILTEREDVIEW(โPatient Details Tableโ,[Station]=[_THISROW].[Stations]) expression, and then proceed to add a new entry through the table by tapping on the + button, then the form view gets populated with the specific station. What Iโm trying is to directly enter the form view without having to go through the table. Do let me know if thatโs possible.
Thanks
It sounds like you should be just about there with your bolded formula. Maybe just a typo but I think you need to remove the โsโ from the last โStationโ.
LINKTOFORM(โPatient Details Tableโ,โStationโ,[_THISROW].[Stations])
to
LINKTOFORM(โPatient Details Tableโ,โStationโ,[_THISROW].[Station])
Is this โPatient Details Tableโ your form viewโs name? When you are using LINKTOFORM deep link, you need to use the form name. Another reason could be the column nameโฆ like โStationโ needs to be exactly the same than in your table and itโs case sensitive. Finally the [_THISROW] is not needed so you can type it just [Station].
Yes, thatโs the form name, and the formโs enum column is called โStationโ. When the app starts up, Iโm in โUroStationsโ table, and in that, the column called โStationsโ has a list of hospitals. I have displayed these list of hospitals in the โStationsโ column as a card view, and when I select a card, I go to the detail view of that value (now the view is Stations_Detail). When Iโm in the Stations_Detail view, there are a set of behavior actions in it displayed as buttons. When I tap the โNew Entryโ button, I want to display the new entry form view (form viewโs name is โPatient Details Tableโ) with the โStationโ enum type pulldown menu in this form pre-populated with the same hospital name that I was in when I was in Stations_Detail view.
But somehow this doesnโt work.
Are both โStationโ columns Enum fields?
One in the โUroStationsโ table is called โStationsโ. In the Google Sheet, this โStationsโ column has a list of hospitals. In the App, this is the starting point of the app showing these list of hospitals because I have made โUroStationsโ table as the starting point of the app, and made it as a card view. When I select a card (which means a hospital name), I go to the detail view of it. So I have not converted it to an enum type column, that column inside the app has been a text type column, because it doesnโt really matter for it to be an Enum type column is it, since I use the โUroStationsโ table to display a set of hospital names at the start of the app.
But in the โPatient Details Tableโ (which I have displayed as a form view in the app), thereโs a column called โStationโ, and it is an Enum type column and it is the one that has the ValidIf expression written to it to bring down the same set of hospital names from the โStationsโ column in the โUroStationsโ table - the ValidIf expression I wrote is UroStations[Stations]. That bit works fine. When I hit the button โNew Entryโ, it brings down the โPatient Details Tableโ form view too. What I want is to pre-populate that โStationโ column with the same hospital name that I was in. Looks like itโs undoable. I tried many a time, but failed.
What is your account ID and app name if I check your app structure?
It appears that, LINKTOFORM expression doesnโt recognize the columns in the form view. I tried writing โStationโ as [Station], and it says it cannot find a column called [Station], when in fact in the form view, thereโs a column called [Station].
SLAUSDatabase-838512
I have given a hypothetical name for the form view here called โPatient Details Tableโ, when in fact the form view name in the app is called โNew Entryโ and this form view is based on a table called โPersonal Detailsโ, I didnโt put that here in case you got confused.
At least this is wrongโฆ LINKTOFORM(โNew Entryโ,โStationโ=[Stations]) should be
LINKTOFORM(โNew Entryโ,โStationโ,[Stations])
Whoa, now it works!!! I guess taking off the [_THISROW] did the trick. That is the only combination I didnโt try! Thank you Aleksi!
The main reason was the โNew Entryโ=[Stations]
But actually having [_THISROW] made it NOT work. I just tried again with [_THISROW] in it, and it didnโt work! When I took it off, it works! Thank you very much for this.
Yes thatโs true.
User | Count |
---|---|
35 | |
35 | |
28 | |
23 | |
18 |