Hi,
I have an app that patches a bunch of comboboxes into sharepoint, there is a slight difference to this app and the "normal" way of just straight patching and that is the actual row data vs displayed value. For example the values displayed in the comboboxes are words but the patch sends code to the database and displayed in a gallery ie the word "Normal" would be displayed in the combobox but patched to the database and displayed in a gallery as "NM" for example
The comboboxes values are made from a table that runs on start, which looks like the following example
ClearCollect(
colExample,
{
Id: 0,
CODE: "",
Word: ""
},
{
Id: 1,
CODE: "NM",
Word: "Normal"
},
There is also various modes which change the comboboxes value depending on what the user is doing, ie varMode = "New" would display blank values, varMode = "Edit" would be a Lookup to display the gallery selected item in words and varMode = "Continue" or "Final" would be a Lookup to display the galleries last entered data. (Its preempting the values the user will most likely use, but they can change if necessary, 99% of the time its the same value) Getting the last entered data to display does not work when i use LastN or Last, ie.
If(
varMode = "New" && IsEmpty(GeologySelectGallery.AllItems),
LookUp(
colGeologyMoist,
MCODE = ""),
varMode = "Edit",
LookUp(
colGeologyMoist,
MCODE = GeologySelectGallery.Selected.MOIST
),
varMode = "Continue" && NextSampleID_1.Text = "RZ000001",
LookUp(
colGeologyMoist,
MCODE = ""),
varMode = "Continue" || varMode = "Final",
LookUp(
colGeologyMoist,
MCODE = LastN(GeologySelectGallery.Selected.MOIST))
)
Error msg is "The function LastN has some invalid arguments"
or
If(
varMode = "New" && IsEmpty(GeologySelectGallery.AllItems),
LookUp(
colGeologyMoist,
MCODE = ""),
varMode = "Edit",
LookUp(
colGeologyMoist,
MCODE = GeologySelectGallery.Selected.MOIST
),
varMode = "Continue" && NextSampleID_1.Text = "RZ000001",
LookUp(
colGeologyMoist,
MCODE = ""),
varMode = "Continue" || varMode = "Final",
LookUp(
colGeologyMoist,
MCODE = Last(GeologySelectGallery.Selected).MOIST)
)
Error msg is "Invalid argument type (Table). Expecting a record value."
Could someone shed some light on how to display the last record value for the variable?