Exporting Custom user field

Hi All

I am wondering if I can save and export “Custom user data” into Form/Case export.

I have edited mobile worker field and added a new field “ABC”. Now I can see this “ABC” field under user case data and I am also getting output stored under this field “ABC” in application if I try to get it in any question. But when I try to export this field data either in form/case export, I am not getting this field during export creation.

I also tried to store this value in a hidden value by putting below expression:

if(count(instance('commcaresession')/session/user/data/abc) > 0, instance('commcaresession')/session/user/data/abc, "Unknown")

but hidden value is not giving any output if i put this hidden value in any question in application.

Looking for your expert support on this.

When you say

I am also getting output stored under this field “ABC” in application"

How are you referencing the field? Is that the same way you're referencing it in the hidden value?

Thanks Ethan for your reply on this.

i just drag and drop this field "ABC" in any question for example "label" and get the value stored in this field.

Like this

image

I see - can you try dragging and dropping that same thing to your hidden value rather than using the instance('commcaresession')/session/user/data/abc expression?

I suspect the issue here is that in one place you're receiving the property from the user case, and in the other, you're pulling from the user registration element of the session. The registration element I believe only contains user data set on on the website from directly editing a user or by bulk importing users. If you modify the user case from within an application, I think that change will only be reflected on the user case (though I'm not certain of this).

Thanks again for your continuous support on this ETHAN. I can see value in hidden value with the expression like in case details

i am more worried about why i am not able to see these values in Form/case exports. How can i fetch these values in an export. All these fields are selected while i have created a new export (Form/Case) but when i download these exports, i dont get any value under these fields except three dots (---) .

The value is now appearing in the form, is that right? If the hidden value does compute that value, then it should be available in the export. What if you view the form in the submit history report - does it appear there?

Are you looking at the same form submissions in the export that you've tested sucessfully? One difficulty with this sort of change is that it's not retroactive - all forms submitted before the change was made will be missing that value.

If you do have a form submission that shows the value in the submit history report, but not in exports, could you report an issue so the support team can look at the specifics?

Thanks Ethan for all your support. Issue is resolved now. Actually form were reaching server with delay and now i can see the value in form/case export.

Thanks again for all your support and Guidance on this, i appreciate it :slight_smile:

Glad to hear it's resolved!

Dear Afroz,

When you import cases in commcare through manual process, neither the data not be exported in excel sheet nor seen in the submit history. If you want these cases you need to download data using commcare export tool