Calculate functions

Hi there,

I am trying to generate unique ID of registered event using calculate option. However, by using the logic you explained in the help section, I always get a following error message : ,

There has been a problem trying to replace ${project_title} with the XPath to the survey element named ‘project_title’. There is no survey element with this name.

This is the code I used
concat(${project_title},“-”${event_type},“-”${community},“-”${commencing_on})

And this is the Questions I build in the form:

  1. Project title
  2. Event type
  3. Community
  4. Commencing on

What I would like to get a unique event code pertaining data from the above items, eg. EU-WS-ZE-12-12-23

if the answers on the items are:
1- EU
2- Workshop
3-Zenica
4-12-12-23

Would could be a possible problem or mistake I made while constructing the code.

Thanks!

Hi,

Do you have any question in your form named as " project_title"? It is probably, because you don’t have this named question, and Kobo can’t find the question and throws and error

1 Like

Hello @osmanburcu

I do have and that’s the first question in the form. This is why I am confused-

can you share the xls version of your form, so i can review? I would be much easier to solve

1 Like

I believe this part is the mistake, It should be like:

concat(${project_title},“-”,${event_type},“-”,${community},“-”,${commencing_on})

1 Like

I am unable to to upload a xsl document since I am a new user, however, I am going to try ur version.

Nope, still the same error message… :frowning:

I believe you are able to upload it to drive and share the drive link

1 Like

He he … yes, ok here it is:

aTFZwLXQLXkj6wcFwZbGVy.xlsx (7.7 KB)

I am really grateful for all your support.

Hi again,

I think you are writing the wrong XML values, that’s why you face the issue, you need to write the “name” column values between ${}. as i can’t see the whole name column, so you can find the part of the code below. If you can share the Excel version of the form instead of PDF, i can give the formula directly

concat(${Title},“-”,${Event},“-”,${??},“-”,${Starting})

1 Like

You should be able to download excel file

aTFZwLXQLXkj6wcFwZbGVy.xlsx (7.7 KB)

and again … not working :frowning: my god

let me review and comeback

1 Like

Please Try this one, it is working

aTFZwLXQLXkj6wcFwZbGVy.xlsx (12.1 KB)

1 Like

Hi, To be able to help, if you can share the xls form, i can try to help

1 Like

YES!

It works perfectly.

1 Like

@osmanburcu, :clap: :heart: :partying_face:

Hint, in case you don’t know yet, please
You can always use the Online validator to check your form, during development and before deployment. Often, also, the search function of this forum can provide help and examples, e.g. Search results for 'There has been a problem trying to replace ' - KoboToolbox Community Forum.

1 Like

Thanks for the tips.