NueForm

Variables

Real-time text substitution के साथ dynamic, personalized forms बनाने के लिए answer variables, URL variables, और form variables का उपयोग करें।

Overview

NueForm में variables आपको dynamic, personalized form experiences बनाने देते हैं। आप respondent answers, URL parameters, और custom form variables को {variableName} substitution syntax का उपयोग करके अपने question titles, descriptions, welcome screens, और thank-you screens में कहीं भी reference कर सकते हैं।

Variables के Types

NueForm तीन types के variables support करता है:

1. Answer Variables

Answer variables respondent के किसी specific question के answer को capture करते हैं और बाद के questions में उपयोग के लिए उपलब्ध बनाते हैं।

कैसे set up करें:

  1. Form builder में एक question select करें।
  2. Question settings में, Answer Variable field खोजें।
  3. एक variable name दर्ज करें (जैसे, name, company, rating)।
  4. उस question पर respondent का answer अब {name}, {company}, या {rating} के रूप में store होता है।

उदाहरण:

  • Question 1: "What is your name?" (Answer Variable: name)
  • Question 2 title: "Nice to meet you, {name}! What brings you here today?"

जब respondent Question 1 के लिए "Sarah" type करता है, Question 2 display करेगा: "Nice to meet you, Sarah! What brings you here today?"

Value coercion:

Answer Typeइस रूप में Store होता है
Text (string)Text value सीधे
NumberNumeric value string के रूप में
Boolean (Yes/No)"true" या "false"
Array (multi-select)Comma-separated values (जैसे, "Option A, Option B")
Object (contact info, address)JSON string
Null/undefinedEmpty string

2. URL Variables

URL variables वे values हैं जो URL query parameters के माध्यम से form में pass की जाती हैं। ये form load होने पर तुरंत उपलब्ध हैं, कोई भी question answer होने से पहले।

कैसे उपयोग करें:

अपने form URL में query parameters append करें:

text
https://nueform.io/f/my-form?firstName=John&company=Acme&source=email

ये parameters स्वचालित रूप से variables के रूप में उपलब्ध होते हैं:

  • {firstName} "John" resolve होता है
  • {company} "Acme" resolve होता है
  • {source} "email" resolve होता है

Use cases:

  • Known data से form fields pre-populate करें।
  • Greetings personalize करें: "Hi {firstName}, we have some questions for you."
  • अपने response data में referral sources track करें।
  • URL parameters के आधार पर start logic jumps का उपयोग करके respondents को route करें।

URL variables logic jump conditions में भी उपयोग किए जा सकते हैं। Condition field में variable name को url: prefix करके reference करें (जैसे, url:source)। URL variable lookups case-insensitive fallback support करते हैं, इसलिए ?FirstName=John url:firstname पर condition से match होगा।

3. Form Variables

Form variables पूर्वनिर्धारित variables हैं जिनमें name, type, और default value होता है। ये form level पर define होते हैं और logic jumps में variable actions द्वारा modify किए जा सकते हैं।

कैसे define करें:

Form variables form की variable definitions में define होते हैं और इनमें निम्नलिखित properties होती हैं:

Propertyविवरण
NameVariable name (जैसे, score, category, is_qualified)।
Typeया तो number या string
Default ValueForm load होने पर initial value।

कैसे modify होते हैं:

Form variables logic jumps पर variable actions के माध्यम से modify होते हैं। जब logic jump की condition match होती है, तो इसके associated variable actions execute होते हैं:

Actionविवरणउदाहरण
setVariable की value replace करें।category को "premium" पर set करें
addVariable में number add करें।score में 10 add करें
subtractVariable से number subtract करें।score से 5 subtract करें

उदाहरण: Score calculator बनाना

  1. एक form variable define करें: score (type: number, default: 0)।
  2. प्रत्येक question पर, variable actions के साथ logic jumps जोड़ें:
    • यदि Rating >= 4, score में 10 add करें।
    • यदि Rating >= 2, score में 5 add करें।
  3. Thank-you screen पर: "Your score is {score} out of 50."

Substitution Syntax

{variableName} syntax निम्नलिखित locations में काम करता है:

LocationSupported
Question titlesहाँ
Question descriptionsहाँ
Welcome screen titleहाँ
Welcome screen descriptionहाँ
Thank-you screen titleहाँ
Thank-you screen descriptionहाँ
Form titleहाँ
Form descriptionहाँ
Choice labelsनहीं
Button textनहीं
QR Code URL templatesहाँ

Substitution कैसे काम करता है

  1. System text को {variableName} patterns (single curly braces के अंदर word characters) के लिए scan करता है।
  2. यह current variables map में variable name look up करता है।
  3. मिलने पर, token variable की value से replace होता है।
  4. न मिलने पर, token empty string से replace होता है।

Variable names single curly braces {name} उपयोग करते हैं। इसे Markdown inline field syntax से confuse न करें, जो double curly braces {{type:label}} उपयोग करता है। दोनों syntaxes जानबूझकर अलग हैं और conflict नहीं करते।

Variable Detection

NueForm स्वचालित रूप से आपके form में reference किए गए सभी variables detect करता है, scan करके:

  • सभी text fields (titles, descriptions, welcome/thank-you screens) में {variableName} tokens।
  • Logic jump conditions में url: prefixed fields।
  • Logic jump actions में variable names।
  • Questions पर answerVariable declarations।
  • Form-level variable definitions।

यह comprehensive scan आपके form में उपयोग किए गए सभी variable names की sorted, deduplicated list produce करता है।

Variable Resolution Order

{variableName} token resolve करते समय, NueForm इस क्रम में variables check करता है:

  1. URL variables -- form URL के माध्यम से pass किए गए।
  2. Answer variables -- answerVariable configured questions पर respondent के answers द्वारा set।
  3. Form variables -- form level पर define और logic jump actions द्वारा modify किए गए।

यदि एक ही variable name multiple sources में exists करता है, तो URL variables प्राथमिकता लेते हैं (क्योंकि ये form/answer variables के साथ merge होकर substitution function में pass किए जाने वाले source हैं)।

उदाहरण

Personalized Welcome

URL: https://nueform.io/f/feedback?name=Sarah&product=Widget

Welcome Title: "Hi {name}!" Welcome Description: "We'd love to hear your thoughts on {product}."

Result: "Hi Sarah!" / "We'd love to hear your thoughts on Widget."

Dynamic Follow-up Questions

Question 1: "What is your role?" (Answer Variable: role) Question 2: "As a {role}, what is your biggest challenge?"

Calculated Score Display

Form Variable: score (number, default: 0) Logic Jump Actions: Answers के आधार पर points add करें Thank-you Description: "You scored {score} points! Thanks for completing the quiz."

URL Variables के साथ Conditional Routing

URL: https://nueform.io/f/survey?plan=enterprise

Start Logic Jump:

  • Condition: url:plan equals "enterprise"
  • Destination: Enterprise-specific questions पर jump करें
  • Action: plan_name को "Enterprise" पर set करें

सर्वोत्तम प्रथाएं

  1. Descriptive names उपयोग करें: Variable names चुनें जो स्पष्ट रूप से indicate करें कि वे क्या store करते हैं (जैसे, n के बजाय customer_name)।
  2. Defaults set करें: Form variables के लिए, हमेशा meaningful default value प्रदान करें यदि variable कभी modify न हो।
  3. URL parameters के साथ test करें: URL variables उपयोग करते समय, सभी paths सही काम करते हैं यह सुनिश्चित करने के लिए विभिन्न parameter combinations के साथ अपने form test करें।
  4. Missing variables को gracefully handle करें: यदि कोई URL variable provide नहीं किया जा सकता, तो अपना text ऐसे design करें कि variable empty string resolve होने पर भी naturally पढ़ा जाए।
अंतिम अपडेट: 6 अप्रैल 2026