Instance name linked to select_multiple choice

Hello,

I need to link a choice from a select_multiple Anchorage_ID to the instance name:
concat('Anclaje superior',' - ',${Anchorage_ID})

the concat function doesn't work and i get the default name.

i tried to change the slect_multiple to a manual introduction of the value and the form is renamed to the right name. But the folder remains with a default number like: Template_2024-04-06_03-17-54

thanks!

Could you provide a related extract of your form, please?

Can you try what happens for

  • showing a text field with calculation
    ${Anchorage_ID}
  • using this text field in the concat
  • type select_one?
1 Like

Thanks Wroos!

I tried but still the same results:

The form is named acording to the contact instruction but the instance folder gets a different name:
Pylon_Anchorage + date of completion

this is the name i get for the instance folder: Pylon_Anchorage_2024-04-07_10-15-27

I need the exact folder name: to find pictures afterwards and link them.

Pylon_Anchorage + ID + date of completion would be ideal

Regards!

Best create and use a clone for testing.
Can you, please, with the text field, a) adding a label or b) changing its type to calculate?
You may test also change the form_id naming to see where the automatic folder name comes from
Best create and use a clone for testing.

1 Like

I've already found this post:

It looks like the instance folder is created before adding any value, so it is not possible...

Ciao @AHidalgo,

If I am not mistaken, the formula for instance is correct, however, the ${Anchorage_ID} seems to be a select_multiple, which means you can't access a single value or label (name or label columns) without specifying the index at which you want to retrieve the value at.

You might want to try the following:

  • Create a calculate field: anchorage_id_txt with calculation
    selected-at(${Anchorage_ID},0) or
    jr:choice-name(selected-at(${Anchorage_ID},0), '${Anchorage_ID})
  • The first calculation gives you the id/value/name while the second gets you the corresponding 'label'.

Otherwise, try changing the type to select_one as @wroos suggested to see if the instance picks the value, then, you can tailor your solution from there

Best regards,
Jules R

@AHidalgo you may want to provide more information on your workflow because it sounds like it's not typical. You're not using a server, is that right? You want to pull submissions directly from Collect and then act on their media in some way?

You could consider using Briefcase: https://docs.getodk.org/briefcase-using/. Although it's no longer maintained, it does still work. You will need to point it to the folder for the Collect project you're working in, though, not the root of the Collect directory. It will enable you to export a CSV with your data and a flat folder with all media. You can then use the CSV to identify the filename of the media that correspond to any given submission.

If you don't want to use Briefcase, I would recommend iterating over all the submissions that you get and then you can either rename media files/folders based on submission data or do the necessary processing as you go.

Hi @jules_rugwiro thanks for the sugestion!!!
I tried but it dind't work. I changed to a selected one but as I said before It looks like folder name is created at the moment you select the blank form before anything is evaluated.

@LN Im trying to make some structure inspections through predefined forms and take pictures on most of the field, and try to have the information sorted. Most of my work depends on labeled and sorted pictures and a report with all the pictures. And some field values.

Now I'm not using a server, now I'm working offline. and I'm exploring to find one and try to use it.

I will try to use briefcase, I was trying to copy from the instance folder.

Thanks!