Hi there.
Some context. I have an attachments box for users to insert files. I have a 'submit' button next to it. When the attachments box has 3 attachments, the submit button will change its DisplayMode from 'View' to 'Edit', and vice versa. There is also a save button, so they can save before they submit.
Here's the predicament: I use a count to check how many attachments there are, which is fine, however the count doesn't consider whether they're saved or not. This leads to an issue where there can be 3 unsaved attachments, and the submit button change to 'Edit', but in reality if they aren't saved nothing will be submitted.
Is there a way to count only SAVED attachments, to save this from occurring?
Thank you!
Solved! Go to Solution.
Hi @Alfie_Smith ,
Yes you can get both totals (saved and unsaved) - you just need to reference two different things. For the number in the control use (saved and unsaved)
CountRows(AttachmentControlName.Attachments)
This can be a label anywhere on the form or set into a variable.
For the number saved - a couple of options - put a label in a card somewhere on the relevant form - you can put it in the attachment control and
CountRows(ThisItem.Attachments)
will get the number currently saved. - you could hide this and set a variable or display it elsewhere referring to it.
If the form is selected from a gallery and the gallery is based directly on the data source (not a collection)
CountRows(GalleryName.Selected.Attachments)
again you could set a variable on this.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Hi @Alfie_Smith ,
Yes you can get both totals (saved and unsaved) - you just need to reference two different things. For the number in the control use (saved and unsaved)
CountRows(AttachmentControlName.Attachments)
This can be a label anywhere on the form or set into a variable.
For the number saved - a couple of options - put a label in a card somewhere on the relevant form - you can put it in the attachment control and
CountRows(ThisItem.Attachments)
will get the number currently saved. - you could hide this and set a variable or display it elsewhere referring to it.
If the form is selected from a gallery and the gallery is based directly on the data source (not a collection)
CountRows(GalleryName.Selected.Attachments)
again you could set a variable on this.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
User | Count |
---|---|
187 | |
105 | |
89 | |
45 | |
43 |
User | Count |
---|---|
237 | |
105 | |
104 | |
66 | |
66 |