- Posts: 7
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
RPC / API: set attributes with set_question_properties
2 months 2 weeks ago #241568
by FherStk
RPC / API: set attributes with set_question_properties was created by FherStk
Please help us help you and fill where relevant:
Your LimeSurvey version: Versión 3.21.1+191210
Own server
Survey theme/template: based on vanilla
==================
Dear community,
I'm copying a survey calling the API via C# and I'm trying to change some survey/question data. I'm able to change almost everything except two things:
Thanks in advance,
Fher
Your LimeSurvey version: Versión 3.21.1+191210
Own server
Survey theme/template: based on vanilla
==================
Dear community,
I'm copying a survey calling the API via C# and I'm trying to change some survey/question data. I'm able to change almost everything except two things:
- Critical: I need to change the "equation" value under "attributes" for some questions. I can change the "question" value with no problems, but I can't change anything under "attributes".
- Works: sending this JSON as "aQuestionData" changes the "question" value:
{
"question" : "degree: {'MY_VALUE'}"
}
- Doesn't work: Sending this JSON as "aQuestionData" does not change the "equation" value:
{
"attributes" : {
"equation": "{'MY_VALUE'}",
"hidden": "1"
}
}
- Works: sending this JSON as "aQuestionData" changes the "question" value:
- Optional: I would like to change the survey group, but I wasn't able to find a valid option to do that using the API.
Thanks in advance,
Fher
Please Log in to join the conversation.
- DenisChenu
-
- Offline
- LimeSurvey Community Team
-
Less
More
- Posts: 13144
- Thank you received: 2422
2 months 1 week ago #241626
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic RPC / API: set attributes with set_question_properties
I think this topic can be in development
> Critical: I need to change the "equation" value under "attributes" for some questions. I can change the "question" value with no problems, but I can't change anything under "attributes".
I think you can't update attribute : github.com/LimeSurvey/LimeSurvey/blob/ca...rol_handle.php#L1765
> Optional: I would like to change the survey group, but I wasn't able to find a valid option to do that using the API.
You can't via API : github.com/LimeSurvey/LimeSurvey/blob/ca...rol_handle.php#L1793
2 solution :
- Use import_question function
- Create your own update function , make a Feature request and a pull request ( but you can use your own function before it was merged )
Denis
> Critical: I need to change the "equation" value under "attributes" for some questions. I can change the "question" value with no problems, but I can't change anything under "attributes".
I think you can't update attribute : github.com/LimeSurvey/LimeSurvey/blob/ca...rol_handle.php#L1765
> Optional: I would like to change the survey group, but I wasn't able to find a valid option to do that using the API.
You can't via API : github.com/LimeSurvey/LimeSurvey/blob/ca...rol_handle.php#L1793
2 solution :
- Use import_question function
- Create your own update function , make a Feature request and a pull request ( but you can use your own function before it was merged )
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The following user(s) said Thank You: FherStk
Please Log in to join the conversation.
2 months 1 week ago #241627
by FherStk
Replied by FherStk on topic RPC / API: set attributes with set_question_properties
Thanks a lot for your feedback, I'll try with import_question

Please Log in to join the conversation.
2 months 1 week ago - 2 months 1 week ago #241638
by FherStk
Replied by FherStk on topic RPC / API: set attributes with set_question_properties
Hi,
I was able to create a new survey with import_survey, using an exported one as a template. I was able to do everything I needed but setting up the "survey group/section".
I can see the correct "gsid" within the CSV/TXT file, but once imported, the survey is assigned to the "Default" section.
It is possible to setup this value using the current API?
Thanks again,
Fher
I was able to create a new survey with import_survey, using an exported one as a template. I was able to do everything I needed but setting up the "survey group/section".
I can see the correct "gsid" within the CSV/TXT file, but once imported, the survey is assigned to the "Default" section.
It is possible to setup this value using the current API?
Thanks again,
Fher
Last edit: 2 months 1 week ago by FherStk. Reason: Clarification
Please Log in to join the conversation.
2 months 1 week ago #241763
by FherStk
Replied by FherStk on topic RPC / API: set attributes with set_question_properties
I answer myself: yes, with 'set_survey_properties' and setting the "gsid" after the survey has been created.
Thanks for all your help
Fher
Thanks for all your help

Fher
The following user(s) said Thank You: DenisChenu
Please Log in to join the conversation.