I want to create a new program rule related to a dataelement of file type, I want to know when this dataelement has a file, I tried with d2:hasValue({ #programrulevariable }) function, but it doesn’t work, I tried with { #programrulevariable } == '' but it doesn’t work either, so, How can I evaluate if a filetype dataelement has a value?
Welcome to the community! I’m able to reproduce this issue and I think it’s a bug issue (or a feature request), so I will need to follow up with @tracker-programRules. Would you like to create a jira bug issue through your account in Projects - Jira?
After that please share the link here so other can add comments and follow for notifications.
Ah, sorry! I did the test in Capture, but I see there are some problems with this in Tracker Capture. What I get is that the program rule doesn’t trigger immediately after uploading the file, but after refreshing the browser it does. Another error I’m encountering is that I get a server error when I try to delete an uploaded file. Same with you @Gassim, @dpperalta?
Looks like I was testing in version 40.3.0 but in the Login app | DHIS2 instance, it looks like the program rule is working.
@dpperalta, thanks for working on this, if you check on the latest version, the program rule works in the Capture app.
@superskip, the deleting file issue you shared is different. In the Tracker Capture app, for deleting the file, the issue is in the enrollment page where the file has not yet been uploaded so if the delete button is clicked, the icon changes from delete to upload although the name of the file still appears in the field, if the upload file icon is clicked again, the file is replaced - so it’s only the fact that the name of the file remains in the field after clicking on delete.