Hi,
I'm having a problem with the value of my dropdown not being passed correctly to my collection.
I have a gallery that gets its items from my 'Template' table. Each 'template' contains some values that need to be passed to a new 'Checklist Item' along with user input. One of these inputs is a dropdown.
I'm not allowed to actually create any records unless everything is filled in, so my save button should collect everything from the gallery and then use patch to create new records.
This is the code that runs when I press save.
Patch(
Inspectierapporten,
Defaults(Inspectierapporten),
{
Project: SelectedProject,
Categorie: SelectedCat
}
);
Clear(ItemsToSubmit);
ForAll(
NewReportItems.AllItems,
Collect(
ItemsToSubmit,
{
Rapport: Last(Inspectierapporten),
Categorie: SelectedCat,
Naam: ItemName.Text,
Inspectieresultaat: [@ConclusionDropdown],
Template: SelectedCat.Template
}
)
);
ForAll(
ItemsToSubmit,
Patch(
'Inspectie onderdelen',
Defaults('Inspectie onderdelen'),
{
Rapport: Rapport,
Categorie: Categorie,
Inspectieresultaat: Inspectieresultaat,
Naam: Naam
}
)
)
Now this works for what I need, only the dropdown value is never passed. I'm sure its got something to do with how I save the dropdown in the collection, but I can't seem to figure it out on my own.
I've got two problems with the dropdown:
1). I have a custom option set, but cannot seem to populate the dropdown with the set unless I use this code as ThisItem does not refer to the entity that actually contains the option set field.
[
[@Conclusie].'Niet geïnspecteerd',
[@Conclusie].Goedgekeurd,
[@Conclusie].Gebrek,
[@Conclusie].Afgekeurd,
[@Conclusie].'Niet van toepassing',
[@Conclusie].'In backlog'
]
2). Passing the value to the collection and then successfully patching it to the CDS, which may be a direct result of 1)
I'm sure my code might make some people cringe when they read it, but I'm only just starting with powerapps and CDS in general and I'm very aware it's not elegant at all.
Thanks in advance,
M-
Solved! Go to Solution.
Absolutely bloody typical I'd struggle a day, make a post only to figure it out shortly after.
Turns out I was an idiot.
I needed to pass the ConclusionDropdown.Selected instead of the entire dropdown, and then patch the InspectieResultaatCol.Value. In hindsight, probably should've figured that out sooner.
Absolutely bloody typical I'd struggle a day, make a post only to figure it out shortly after.
Turns out I was an idiot.
I needed to pass the ConclusionDropdown.Selected instead of the entire dropdown, and then patch the InspectieResultaatCol.Value. In hindsight, probably should've figured that out sooner.
User | Count |
---|---|
174 | |
115 | |
86 | |
44 | |
41 |
User | Count |
---|---|
238 | |
150 | |
132 | |
77 | |
73 |